<?php
@session_start ();
require '../mysql_connection/for_u_lijinsheng.php';
$first = true;
$success = true;

if (isset ( $_GET ['username'] )) {
	$first = false;
	$username = $_GET ['username'];
	$password = $_GET ['password'];
	unset ( $_GET ['username'] );
	unset ( $_GET ['password'] );
	if (log_in ( $username, $password )) {
		$_SESSION ['username'] = $username;
		header ( "location:index.php" );
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../u_css/log_in.css" />
<title>登录</title>
</head>
<body>
<h1>Welcome to our shop online</h1>
<div id="log_div">
<form action="http://localhost/e-commerce/user_php/log_in.php">
<div><label> 用户名:<input type="text" name="username" id="username" /> </label>
<br />
<label> 密码:<input type="password" name="password" id="password" /> </label>
<br />
<input type="submit" id="submitbutton" value="登录" /></div>

</form>
<?php
if (! $first) {
	?>
	<p class="notify">用户名或密码错误</p>
<?php
}
?>
</div>
</body>
</html>